Skip to content

Conversation

@dkundel-openai
Copy link
Collaborator

@dkundel-openai dkundel-openai commented Jul 16, 2025

Depending on the turn detection settings the Realtime API might cancel an ongoing response automatically which in the current code might run into occasional race conditions with the this.#ongoingResponse check which in turn causes errors.

This change shuffles the logic around so that if an interruption is happening because of turn detection it will check if the session config has cancellation of responses enabled and only cancel if not. For other interruption calls like guardrails or manual interruptions we will still perform an interruption.

This change isn't needed in WebRTC because the turn detection based interruptions happen server side.

@changeset-bot
Copy link

changeset-bot bot commented Jul 16, 2025

🦋 Changeset detected

Latest commit: 9937e2f

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
@openai/agents-extensions Patch
@openai/agents-realtime Patch
@openai/agents Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@dkundel-openai dkundel-openai force-pushed the dkundel/fix-interruptions-ws branch from 52f9f33 to a1cb6bf Compare July 16, 2025 21:08
@dkundel-openai dkundel-openai marked this pull request as ready for review July 16, 2025 21:10
@seratch seratch added bug Something isn't working package:agents-realtime labels Jul 16, 2025
@seratch
Copy link
Member

seratch commented Jul 16, 2025

Create changeset and get it merged 👍

@seratch seratch merged commit f6e68f4 into main Jul 16, 2025
5 checks passed
@seratch seratch deleted the dkundel/fix-interruptions-ws branch July 16, 2025 23:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working package:agents-realtime

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants